package cn.tedu.csmall.stock.webapi.until;

import cn.tedu.csmall.commons.pojo.stock.dto.StockReduceCountDTO;
import cn.tedu.csmall.commons.restful.JsonResult;
import cn.tedu.csmall.commons.restful.ResponseCode;
import com.alibaba.csp.sentinel.slots.block.BlockException;

/**
 *自定义限流类
 */
public class BlockErrorHandler {
    /**
     * 自定义限流方法
     */
    public static JsonResult blockError(StockReduceCountDTO stockReduceCountDTO,
                                 BlockException e){
        return JsonResult.failed(ResponseCode.BAD_REQUEST,"你被限流了");
    }
}
